﻿@using System.Web.Optimization
@using Ed.Entity
@using Ed.Web.Helpers
@model List<Dictionary<string, object>>
@{
    Layout = null;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>雪绒花_客户管理首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link href="/Themes/default/lib/bootstrap/css/bootstrap-3.2.0.css" rel="stylesheet" />
    <link href="/Themes/default/lib/bootstrap/assets/css/docs.css" rel="stylesheet" />
    <link href="/Themes/default/lib/artDialog/css/ui-dialog.css" rel="stylesheet" />
    <script src="/Themes/default/lib/jquery/jquery-1.11.1.js"></script>
    <script src="/Themes/default/lib/cookie/jquery.cookie.js"></script>
    <script src="/Themes/default/lib/artDialog/dist/dialog-plus-min.js"></script>
    <script src="/Themes/default/lib/function.js"></script>
    <!--去除顶层加载中 14-10-17 By 唐有炜-->
    <script type="text/javascript">
        //=============================================================
        //去除顶层加载中
        $(document).ready(function () {
            //去除加载中
            if (undefined != top.dialog.list["show_loading"]) {
                top.dialog.list["show_loading"].close().remove();
                //showTopMsg("页面加载成功！", "温馨提示", "Success");
            }
        });
        //=====================================================================
    </script>
    <script type="text/javascript">


        function show_add() {
            showTopWindow("show_add_client", "/Customer/ClientInfo/Add?actionType=Add", null, 800, 380, function () {
                var client_form = $(top.window.frames["frm_show_add_client"].document).find("#clientinfo_form");
                var flag = top.document.getElementById("frm_show_add_client").contentWindow.form_valid();
                if (!flag) {
                    return false;
                }
                //var data = $(client_form).serializeObject();
                var data = $(client_form).serialize();
                //console.log(data);
                //return;
                $.ajax({
                    type: "POST",
                    cache: false,
                    url: "/api/ClientInfoApi/AddClientInfo/",
                    data: data,
                    dataType: "json",
                    beforeSend: function () {
                        //showMsg("添加中，请稍后...");
                    },
                    complete: function () {
                        //d.close().remove();
                    },
                    success: function (result) {
                        //toLowerCase报错
                        //var status = result.Status.toLowerCase();
                        var status = result.Status;
                        if (status == true || status == "true" || status == "True") {
                            //关闭当前
                            top.dialog.list["show_add_client"].close().remove();
                            //打开列表
                            show_business();

                        } else {
                            showMsg("系统异常，客户添加失败！", "Error");
                        }
                    },
                    error: function () {
                        showMsg("网络连接错误!", "错误提示", "Error");
                    }
                });
                //必须有这个，阻止刷新
                return false;
            });
        }
        function show_list() {
            showTopContentWindow("show_list", "/Customer/ClientInfo/List", "全部客户信息管理", 1000, 500);
        }
        function show_business() {
            showTopContentWindow("show_list", "/Customer/ClientInfo/Business", '@Html.Raw("【" + @Session[EdKeys.SESSION_USER_NAME] + "】" + "的业务客户")', 1250, 500);
        }
        function show_maintenance() {
            showTopContentWindow("show_list", "/Customer/ClientInfo/Maintenance", '@Html.Raw("【" + @Session[EdKeys.SESSION_USER_NAME] + "】" + "维护客户")', 1000, 500);
        }
        function show_trash() {
            showTopContentWindow("show_list", "/Customer/ClientInfo/Trash", "回收站客户", 1000, 500);
        }
    </script>
</head>
<body>
    <div class="" style="width: 231px; overflow: hidden; border-top: 1px solid #EFEFEF;
        border-left: 1px solid #EFEFEF;">
        <div class="bs-glyphicons">
            <ul class="bs-glyphicons-list">
                @if (Html.LoadModulePowers(@Model, "Customer_add"))
                {
                    <li onclick="show_add()"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon-class">
                        新增客户 </span></li>
                }
                @if (Html.LoadModulePowers(@Model, "Customer_business"))
                {
                    <li onclick="show_business()"><span class="glyphicon glyphicon-user"></span><span
                        class="glyphicon-class">业务客户</span> </li>}
                @if (Html.LoadModulePowers(@Model, "Customer_maintenance"))
                {
                    <li onclick="show_maintenance()"><span class="glyphicon glyphicon-wrench"></span><span
                        class="glyphicon-class">维护客户</span> </li>}
                @if (@Html.LoadModulePowers(@Model, "Customer_list"))
                {
                    <li onclick="show_list()"><span class="glyphicon glyphicon-th"></span><span class="glyphicon-class">
                        全部客户</span> </li>
                }
                @if (Html.LoadModulePowers(@Model, "Customer_trash"))
                {
                    <li onclick="show_trash()"><span class="glyphicon glyphicon-trash"></span><span class="glyphicon-class">
                        回收站客户</span> </li>}
                <div style="clear: both">
                </div>
            </ul>
        </div>
    </div>
</body>
</html>
